package com.x.share.mid.http.client;

import java.util.List;

import org.apache.http.NameValuePair;
import org.apache.http.entity.ContentType;

import com.x.share.mid.http.behavior.HttpBehavior;
import com.x.share.mid.http.behavior.LongConnHttpBehavior;

/**
 * 启用http请求长链接支持
 * <p>
 * 用户通过提供"httpclient.properties"文件配制长链接相关参数,例如:
 * <p>
 * <code>
 * maxConns=10
 * <code>
 * 
 * @author chenheng
 *
 */
public class LongConnHttpClient {
	static HttpBehavior behavior = new LongConnHttpBehavior();

	public static String get(String url) {
		return behavior.get(url);
	}

	public static String get(String url, String params) {
		return behavior.get(url, params);
	}

	public static String post(String url) {
		return behavior.post(url);
	}

	public static String post(String url, String params) {
		return behavior.post(url, params);
	}
	
	public static String post(String url, List<NameValuePair> params) {
		return behavior.post(url, params);
	}

	public static String post(String url, String params, ContentType contentType) {
		return behavior.post(url, params, contentType);
	}

	public static String put(String url) {
		return behavior.put(url);
	}

	public static String put(String url, String params) {
		return behavior.put(url, params);
	}

	public static String put(String url, String params, ContentType contentType) {
		return behavior.put(url, params, contentType);
	}

	public static String delete(String url) {
		return behavior.delete(url);
	}

	public static String delete(String url, String params) {
		return behavior.delete(url, params);
	}
}
